<template>
    <div>
        <p>{{imglist.desc}}</p>
        <hr><hr>
            <img :src="item.img" alt="" v-for="item in imgs" :key='item.img'>       
    </div>

</template>

<script>
export default {
    data () {
        return {
           id:this.$route.params.id,
           imgs:[],  //图文介绍图片集
           imglist:[]
        }
    },
    created () {
        this.getTuWen(this.id)
    },
    methods: {
        getTuWen(id){
            this.$http.get('http://localhost:1000/mobileGoods').then(res=>{           
                 res.body.forEach(element => {                                     
                     if(element.id==id){  
                         this.imglist=element;           
                         this.imgs=element.imgintro
                     }
                 });
             })
        }
    }

}
</script>


<style lang="scss" scoped>
    p{
        background: #fff;
        color: #26a2ff;
        padding: 10px;
    }
    img{
        width: 100%;
    }

</style>

